// src/api/user.js
import request from './request'

// 用户基础操作
export const getUserList = () => request.get('/users/listAllUser')
export const createUser = (data) => request.post('/users', data)
export const UserRegister = (data) => request.post('/users/register', data)
export const UserUpdate = () => request.put('/users/update')
export const deleteUser = (id) => request.delete(`/users/${id}`)
export const submitAlumniCard = (data) => request.post('/users/alumniCard', data)
// 登录相 关
export const login = (data) => request.post('/auth/login', data)

// 头像上传
export const uploadAvatar = (formData) => request.post('/users/avatar', formData, {
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})

// 修改昵称
export const updateNickname = (data) => request.put('/users/nickname', data)

// 修改密码
export const updatePassword = (data) => request.put('/users/password', data)

// 退出登录
export const logout = () => request.post('/auth/logout')
